<?php

namespace common\models;

use Yii;
use yii\behaviors\TimestampBehavior;

/**
 * This is the model class for table "{{%course_signup}}".
 *
 * @property integer $id
 * @property integer $cid
 * @property string $name
 * @property string $id_card
 * @property string $tel
 * @property string $addr
 * @property integer $created_at
 * @property integer $updated_at
 */
class CourseSignup extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%course_signup}}';
    }

    // 行为
    public function behaviors()
    {
        return [
          [ 'class' => TimestampBehavior::className()]
        ];
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['cid', 'name', 'id_card', 'tel', 'addr'], 'required'],
            [['cid'], 'integer'],
            [['name', 'id_card', 'tel'], 'string', 'max' => 255],
            [['addr'], 'string', 'max' => 10],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'cid' => '科目',
            'name' => '姓名',
            'id_card' => '身份证',
            'tel' => '手机',
            'addr' => '地址',
            'created_at' => '报名时间',
            'updated_at' => '更新时间',
        ];
    }
}
